

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>cortex.built_ins.datasets package &mdash; Cortex2.0  documentation</title>
  

  
  
  
  

  

  
  
    

  

  <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="cortex.built_ins.models package" href="cortex.built_ins.models.html" />
    <link rel="prev" title="cortex.built_ins package" href="cortex.built_ins.html" /> 

  
  <script src="_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="index.html" class="icon icon-home"> Cortex2.0
          

          
          </a>

          
            
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">User Documentation</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="install.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting Started</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">cortex</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="cortex.html">cortex package</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="cortex.html#subpackages">Subpackages</a><ul class="current">
<li class="toctree-l4 current"><a class="reference internal" href="cortex.built_ins.html">cortex.built_ins package</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="cortex.html#submodules">Submodules</a></li>
<li class="toctree-l3"><a class="reference internal" href="cortex.html#module-cortex.main">cortex.main module</a></li>
<li class="toctree-l3"><a class="reference internal" href="cortex.html#module-cortex.plugins">cortex.plugins module</a></li>
<li class="toctree-l3"><a class="reference internal" href="cortex.html#module-cortex">Module contents</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="develop.html">Develop</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html">Custom demos</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html#a-walkthrough-a-custom-classifier">A walkthrough a custom classifier:</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html#defining-losses-and-results">Defining losses and results</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html#visualization">Visualization</a></li>
<li class="toctree-l1"><a class="reference internal" href="build.html#putting-it-together">Putting it together</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">Cortex2.0</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="index.html">Docs</a> &raquo;</li>
        
          <li><a href="modules.html">cortex</a> &raquo;</li>
        
          <li><a href="cortex.html">cortex package</a> &raquo;</li>
        
          <li><a href="cortex.built_ins.html">cortex.built_ins package</a> &raquo;</li>
        
      <li>cortex.built_ins.datasets package</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="_sources/cortex.built_ins.datasets.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="cortex-built-ins-datasets-package">
<h1>cortex.built_ins.datasets package<a class="headerlink" href="#cortex-built-ins-datasets-package" title="Permalink to this headline">¶</a></h1>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-cortex.built_ins.datasets.CelebA">
<span id="cortex-built-ins-datasets-celeba-module"></span><h2>cortex.built_ins.datasets.CelebA module<a class="headerlink" href="#module-cortex.built_ins.datasets.CelebA" title="Permalink to this headline">¶</a></h2>
<p>Handler for CelebA.</p>
<dl class="class">
<dt id="cortex.built_ins.datasets.CelebA.CelebA">
<em class="property">class </em><code class="descclassname">cortex.built_ins.datasets.CelebA.</code><code class="descname">CelebA</code><span class="sig-paren">(</span><em>root</em>, <em>transform=None</em>, <em>target_transform=None</em>, <em>download=False</em>, <em>split=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/CelebA.html#CelebA"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.CelebA.CelebA" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">torchvision.datasets.folder.ImageFolder</span></code></p>
<dl class="attribute">
<dt id="cortex.built_ins.datasets.CelebA.CelebA.attr_filename">
<code class="descname">attr_filename</code><em class="property"> = 'list_attr_celeba.zip'</em><a class="headerlink" href="#cortex.built_ins.datasets.CelebA.CelebA.attr_filename" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="cortex.built_ins.datasets.CelebA.CelebA.attr_url">
<code class="descname">attr_url</code><em class="property"> = 'https://www.dropbox.com/s/auexdy98c6g7y25/list_attr_celeba.zip?dl=1'</em><a class="headerlink" href="#cortex.built_ins.datasets.CelebA.CelebA.attr_url" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="cortex.built_ins.datasets.CelebA.CelebA.download">
<code class="descname">download</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/CelebA.html#CelebA.download"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.CelebA.CelebA.download" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns:</p>
</dd></dl>

<dl class="attribute">
<dt id="cortex.built_ins.datasets.CelebA.CelebA.filename">
<code class="descname">filename</code><em class="property"> = 'img_align_celeba.zip'</em><a class="headerlink" href="#cortex.built_ins.datasets.CelebA.CelebA.filename" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="cortex.built_ins.datasets.CelebA.CelebA.url">
<code class="descname">url</code><em class="property"> = 'https://www.dropbox.com/sh/8oqt9vytwxb3s4r/AADIKlz8PR9zr6Y20qbkunrba/Img/img_align_celeba.zip?dl=1'</em><a class="headerlink" href="#cortex.built_ins.datasets.CelebA.CelebA.url" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="cortex.built_ins.datasets.CelebA.CelebAPlugin">
<em class="property">class </em><code class="descclassname">cortex.built_ins.datasets.CelebA.</code><code class="descname">CelebAPlugin</code><a class="reference internal" href="_modules/cortex/built_ins/datasets/CelebA.html#CelebAPlugin"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.CelebA.CelebAPlugin" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="cortex.html#cortex.plugins.DatasetPlugin" title="cortex.plugins.DatasetPlugin"><code class="xref py py-class docutils literal notranslate"><span class="pre">cortex.plugins.DatasetPlugin</span></code></a></p>
<dl class="method">
<dt id="cortex.built_ins.datasets.CelebA.CelebAPlugin.handle">
<code class="descname">handle</code><span class="sig-paren">(</span><em>source</em>, <em>copy_to_local=False</em>, <em>normalize=True</em>, <em>split=None</em>, <em>classification_mode=False</em>, <em>**transform_args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/CelebA.html#CelebAPlugin.handle"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.CelebA.CelebAPlugin.handle" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>source</strong> – </li>
<li><strong>copy_to_local</strong> – </li>
<li><strong>normalize</strong> – </li>
<li><strong>**transform_args</strong> – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Returns:</p>
</dd></dl>

<dl class="method">
<dt id="cortex.built_ins.datasets.CelebA.CelebAPlugin.make_split">
<code class="descname">make_split</code><span class="sig-paren">(</span><em>data_path</em>, <em>split</em>, <em>Dataset</em>, <em>train_transform</em>, <em>test_transform</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/CelebA.html#CelebAPlugin.make_split"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.CelebA.CelebAPlugin.make_split" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="cortex.built_ins.datasets.CelebA.CelebAPlugin.sources">
<code class="descname">sources</code><em class="property"> = ['CelebA']</em><a class="headerlink" href="#cortex.built_ins.datasets.CelebA.CelebAPlugin.sources" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="section" id="cortex-built-ins-datasets-dsprites-module">
<h2>cortex.built_ins.datasets.dSprites module<a class="headerlink" href="#cortex-built-ins-datasets-dsprites-module" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-cortex.built_ins.datasets.imagenet">
<span id="cortex-built-ins-datasets-imagenet-module"></span><h2>cortex.built_ins.datasets.imagenet module<a class="headerlink" href="#module-cortex.built_ins.datasets.imagenet" title="Permalink to this headline">¶</a></h2>
<p>Handler for imagenet datasets.</p>
<dl class="class">
<dt id="cortex.built_ins.datasets.imagenet.ImageFolder">
<em class="property">class </em><code class="descclassname">cortex.built_ins.datasets.imagenet.</code><code class="descname">ImageFolder</code><a class="reference internal" href="_modules/cortex/built_ins/datasets/imagenet.html#ImageFolder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.imagenet.ImageFolder" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="cortex.html#cortex.plugins.DatasetPlugin" title="cortex.plugins.DatasetPlugin"><code class="xref py py-class docutils literal notranslate"><span class="pre">cortex.plugins.DatasetPlugin</span></code></a></p>
<dl class="method">
<dt id="cortex.built_ins.datasets.imagenet.ImageFolder.handle">
<code class="descname">handle</code><span class="sig-paren">(</span><em>source</em>, <em>copy_to_local=False</em>, <em>normalize=True</em>, <em>tanh_normalization=False</em>, <em>**transform_args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/imagenet.html#ImageFolder.handle"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.imagenet.ImageFolder.handle" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="cortex.built_ins.datasets.imagenet.ImageFolder.sources">
<code class="descname">sources</code><em class="property"> = ['tiny-imagenet-200', 'imagenet']</em><a class="headerlink" href="#cortex.built_ins.datasets.imagenet.ImageFolder.sources" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="section" id="module-cortex.built_ins.datasets.nii_dataload">
<span id="cortex-built-ins-datasets-nii-dataload-module"></span><h2>cortex.built_ins.datasets.nii_dataload module<a class="headerlink" href="#module-cortex.built_ins.datasets.nii_dataload" title="Permalink to this headline">¶</a></h2>
<p>Module for handling neuroimaging data
We build an “ImageFolder” object and we can iterate/index through
it.  The class is initialized with a folder location, a loader (the only one</p>
<blockquote>
<div>we have now is for nii files), and (optionally) a list of regex patterns.</div></blockquote>
<p>The user can also provide a 3D binary mask (same size as data) to vectorize
the space/voxel dimension. Can handle 3D and 3D+time (4D) datasets So, it can
be built one of two ways:
1: a path to one directory with many images, and the classes are based on
regex patterns.</p>
<blockquote>
<div><blockquote>
<div><dl class="docutils">
<dt>example 1a: “/home/user/some_data_path” has files <em>_H_</em>.nii and <em>_S_</em>.nii</dt>
<dd>files</dd>
</dl>
</div></blockquote>
<dl class="docutils">
<dt>patterned_images = ImageFolder(“/home/user/some_data_path”,</dt>
<dd><blockquote class="first">
<div>patterns=[‘<em>_H_</em>’,’<em>_S_</em>’] , loader=nii_loader)</div></blockquote>
<p class="last">example 1b: “/home/user/some_data_path” has files <em>_H_</em>.nii and <em>_S_</em>.nii
files, and user specifies a mask to vectorize space</p>
</dd>
<dt>patterned_images_mask = ImageFolder(“/home/user/some_data_path”,</dt>
<dd><dl class="first last docutils">
<dt>patterns=[‘<em>_H_</em>’,’<em>_S_</em>’] , loader=nii_loader,</dt>
<dd>mask=”/home/user/maskImage.nii”)</dd>
</dl>
</dd>
</dl>
</div></blockquote>
<dl class="docutils">
<dt>2: a path to a top level directory with sub directories denoting the classes.</dt>
<dd><blockquote class="first">
<div>example 2a: “/home/user/some_data_path” has subfolders 0 and 1 with nifti
files corresponding to class 0 and class 1 respectively</div></blockquote>
<dl class="last docutils">
<dt>foldered_images = ImageFolder(“/home/user/some_data_path”,loader=nii_loader)</dt>
<dd>example 2b: Same as above but with a mask</dd>
<dt>foldered_images = ImageFolder(“/home/user/some_data_path”,loader=nii_loader,</dt>
<dd>mask=”/home/user/maskImage.nii”)</dd>
</dl>
</dd>
</dl>
<p>The final output (when we call __getitem__) is a tuple of: (image,label)</p>
<dl class="class">
<dt id="cortex.built_ins.datasets.nii_dataload.ImageFolder">
<em class="property">class </em><code class="descclassname">cortex.built_ins.datasets.nii_dataload.</code><code class="descname">ImageFolder</code><span class="sig-paren">(</span><em>root</em>, <em>loader=&lt;function nii_loader&gt;</em>, <em>patterns=None</em>, <em>mask=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/nii_dataload.html#ImageFolder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.nii_dataload.ImageFolder" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">torch.utils.data.dataset.Dataset</span></code></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>root</strong> (<em>string</em>) – Root directory path.</li>
<li><strong>patterns</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)"><em>list</em></a>) – list of regex patterns</li>
<li><strong>loader</strong> (<em>callable</em><em>, </em><em>optional</em>) – A function to load an image given its</li>
<li><strong>path.</strong> – <dl class="docutils">
<dt>Attributes:</dt>
<dd>imgs (list): List of (image path, class_index) tuples</dd>
</dl>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="cortex.built_ins.datasets.nii_dataload.ImageFolder.maskData">
<code class="descname">maskData</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/nii_dataload.html#ImageFolder.maskData"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.nii_dataload.ImageFolder.maskData" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> – </td>
</tr>
</tbody>
</table>
<p>Returns:</p>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="cortex.built_ins.datasets.nii_dataload.make_dataset">
<code class="descclassname">cortex.built_ins.datasets.nii_dataload.</code><code class="descname">make_dataset</code><span class="sig-paren">(</span><em>dir</em>, <em>patterns=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/nii_dataload.html#make_dataset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.nii_dataload.make_dataset" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>dir</strong> – </li>
<li><strong>patterns</strong> – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Returns:</p>
</dd></dl>

<dl class="function">
<dt id="cortex.built_ins.datasets.nii_dataload.nii_loader">
<code class="descclassname">cortex.built_ins.datasets.nii_dataload.</code><code class="descname">nii_loader</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/nii_dataload.html#nii_loader"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.nii_dataload.nii_loader" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>path</strong> – </td>
</tr>
</tbody>
</table>
<p>Returns:</p>
</dd></dl>

</div>
<div class="section" id="module-cortex.built_ins.datasets.torchvision_datasets">
<span id="cortex-built-ins-datasets-torchvision-datasets-module"></span><h2>cortex.built_ins.datasets.torchvision_datasets module<a class="headerlink" href="#module-cortex.built_ins.datasets.torchvision_datasets" title="Permalink to this headline">¶</a></h2>
<p>Entrypoint for torchvision datasets.</p>
<dl class="class">
<dt id="cortex.built_ins.datasets.torchvision_datasets.TorchvisionDatasetPlugin">
<em class="property">class </em><code class="descclassname">cortex.built_ins.datasets.torchvision_datasets.</code><code class="descname">TorchvisionDatasetPlugin</code><a class="reference internal" href="_modules/cortex/built_ins/datasets/torchvision_datasets.html#TorchvisionDatasetPlugin"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.torchvision_datasets.TorchvisionDatasetPlugin" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="cortex.html#cortex.plugins.DatasetPlugin" title="cortex.plugins.DatasetPlugin"><code class="xref py py-class docutils literal notranslate"><span class="pre">cortex.plugins.DatasetPlugin</span></code></a></p>
<dl class="method">
<dt id="cortex.built_ins.datasets.torchvision_datasets.TorchvisionDatasetPlugin.handle">
<code class="descname">handle</code><span class="sig-paren">(</span><em>source</em>, <em>copy_to_local=False</em>, <em>normalize=True</em>, <em>train_samples=None</em>, <em>test_samples=None</em>, <em>labeled_only=False</em>, <em>stl_center_crop=False</em>, <em>stl_resize_only=False</em>, <em>stl_no_resize=False</em>, <em>**transform_args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/torchvision_datasets.html#TorchvisionDatasetPlugin.handle"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.torchvision_datasets.TorchvisionDatasetPlugin.handle" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="cortex.built_ins.datasets.torchvision_datasets.TorchvisionDatasetPlugin.sources">
<code class="descname">sources</code><em class="property"> = ['CIFAR10', 'CIFAR100', 'CocoCaptions', 'CocoDetection', 'FakeData', 'FashionMNIST', 'ImageFolder', 'LSUN', 'LSUNClass', 'MNIST', 'PhotoTour', 'SEMEION', 'STL10', 'SVHN']</em><a class="headerlink" href="#cortex.built_ins.datasets.torchvision_datasets.TorchvisionDatasetPlugin.sources" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="section" id="module-cortex.built_ins.datasets.toysets">
<span id="cortex-built-ins-datasets-toysets-module"></span><h2>cortex.built_ins.datasets.toysets module<a class="headerlink" href="#module-cortex.built_ins.datasets.toysets" title="Permalink to this headline">¶</a></h2>
<dl class="docutils">
<dt><code class="xref py py-mod docutils literal notranslate"><span class="pre">cortex2.lib.toysets</span></code> – Small toy datasets for interpretable</dt>
<dd>experimentation</dd>
</dl>
<hr class="docutils" />
<span class="target" id="module-toysets"></span><p>Collection of datasets (mostly 2D) used primarily for benchmarking of
inference algorithms and interpretable experiments in the input space.</p>
<div class="section" id="todos">
<h3>TODOs<a class="headerlink" href="#todos" title="Permalink to this headline">¶</a></h3>
<ol class="arabic simple">
<li>Include common datasets for toying with GANs, like the balanced 2-moons</li>
<li>Fix module title once a proper packaging scheme is introduced</li>
</ol>
<dl class="class">
<dt id="cortex.built_ins.datasets.toysets.A_set">
<em class="property">class </em><code class="descclassname">cortex.built_ins.datasets.toysets.</code><code class="descname">A_set</code><span class="sig-paren">(</span><em>root</em>, <em>*select</em>, <em>stardardize=False</em>, <em>load=False</em>, <em>download=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#A_set"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.A_set" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cortex.built_ins.datasets.toysets._SmallDataset</span></code></p>
<p>Download and use A-sets dataset.</p>
<p>Synthetic 2-d data with varying number of vectors (N) and clusters (k).
There are 150 vectors per cluster.</p>
<dl class="docutils">
<dt>num <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
<dd>Higher <cite>num</cite> means, higher chance of overlapping between the modes.
Choose: [1, 2, 3]</dd>
</dl>
<p>A1: N=3000, k=20
A2: N=5250, k=35
A3: N=7500, k=50</p>
<p>I. Kärkkäinen and P. Fränti,
“Dynamic local search algorithm for the clustering problem”,
Research Report A-2002-6</p>
<dl class="method">
<dt id="cortex.built_ins.datasets.toysets.A_set.check_exists">
<code class="descname">check_exists</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#A_set.check_exists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.A_set.check_exists" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns:</p>
</dd></dl>

<dl class="method">
<dt id="cortex.built_ins.datasets.toysets.A_set.files">
<code class="descname">files</code><span class="sig-paren">(</span><em>num</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#A_set.files"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.A_set.files" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>num</strong> – </td>
</tr>
</tbody>
</table>
<p>Returns:</p>
</dd></dl>

<dl class="attribute">
<dt id="cortex.built_ins.datasets.toysets.A_set.sync_files">
<code class="descname">sync_files</code><em class="property"> = 4</em><a class="headerlink" href="#cortex.built_ins.datasets.toysets.A_set.sync_files" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="cortex.built_ins.datasets.toysets.A_set.urls">
<code class="descname">urls</code><em class="property"> = ['http://cs.joensuu.fi/sipu/datasets/a1.txt', 'http://cs.joensuu.fi/sipu/datasets/a2.txt', 'http://cs.joensuu.fi/sipu/datasets/a3.txt', 'http://cs.joensuu.fi/sipu/datasets/a-gt-pa.zip']</em><a class="headerlink" href="#cortex.built_ins.datasets.toysets.A_set.urls" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="cortex.built_ins.datasets.toysets.Aggregation">
<em class="property">class </em><code class="descclassname">cortex.built_ins.datasets.toysets.</code><code class="descname">Aggregation</code><span class="sig-paren">(</span><em>root</em>, <em>*select</em>, <em>stardardize=False</em>, <em>load=False</em>, <em>download=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#Aggregation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.Aggregation" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cortex.built_ins.datasets.toysets._Shapes</span></code></p>
<p>Download and use the Aggregation dataset.</p>
<p>N=788, k=7, D=2</p>
<p>A. Gionis, H. Mannila, and P. Tsaparas,
Clustering aggregation.
ACM Transactions on Knowledge Discovery from Data (TKDD), 2007.</p>
<dl class="attribute">
<dt id="cortex.built_ins.datasets.toysets.Aggregation.urls">
<code class="descname">urls</code><em class="property"> = ['http://cs.joensuu.fi/sipu/datasets/Aggregation.txt']</em><a class="headerlink" href="#cortex.built_ins.datasets.toysets.Aggregation.urls" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="cortex.built_ins.datasets.toysets.Compound">
<em class="property">class </em><code class="descclassname">cortex.built_ins.datasets.toysets.</code><code class="descname">Compound</code><span class="sig-paren">(</span><em>root</em>, <em>*select</em>, <em>stardardize=False</em>, <em>load=False</em>, <em>download=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#Compound"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.Compound" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cortex.built_ins.datasets.toysets._Shapes</span></code></p>
<p>Download and use the Compound dataset.</p>
<p>N=399, k=6, D=2</p>
<p>C.T. Zahn,
Graph-theoretical methods for detecting and describing gestalt clusters.
IEEE Transactions on Computers, 1971.</p>
<dl class="attribute">
<dt id="cortex.built_ins.datasets.toysets.Compound.urls">
<code class="descname">urls</code><em class="property"> = ['http://cs.joensuu.fi/sipu/datasets/Compound.txt']</em><a class="headerlink" href="#cortex.built_ins.datasets.toysets.Compound.urls" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="cortex.built_ins.datasets.toysets.D31">
<em class="property">class </em><code class="descclassname">cortex.built_ins.datasets.toysets.</code><code class="descname">D31</code><span class="sig-paren">(</span><em>root</em>, <em>*select</em>, <em>stardardize=False</em>, <em>load=False</em>, <em>download=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#D31"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.D31" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cortex.built_ins.datasets.toysets._Shapes</span></code></p>
<p>Download and use the D31 dataset.</p>
<p>N=3100, k=31, D=2</p>
<p>C.J. Veenman, M.J.T. Reinders, and E. Backer,
A maximum variance cluster algorithm.
IEEE Trans. Pattern Analysis and Machine Intelligence 2002.</p>
<dl class="attribute">
<dt id="cortex.built_ins.datasets.toysets.D31.urls">
<code class="descname">urls</code><em class="property"> = ['http://cs.joensuu.fi/sipu/datasets/D31.txt']</em><a class="headerlink" href="#cortex.built_ins.datasets.toysets.D31.urls" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="cortex.built_ins.datasets.toysets.DIM_set">
<em class="property">class </em><code class="descclassname">cortex.built_ins.datasets.toysets.</code><code class="descname">DIM_set</code><span class="sig-paren">(</span><em>root</em>, <em>*select</em>, <em>stardardize=False</em>, <em>load=False</em>, <em>download=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#DIM_set"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.DIM_set" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cortex.built_ins.datasets.toysets._SmallDataset</span></code></p>
<p>Download and use the (high) DIM-sets dataset.</p>
<p>High-dimensional data sets N=1024 and k=16 Gaussian clusters.</p>
<dl class="docutils">
<dt>dim <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
<dd>Dimension of the input space. Choose: [32, 64, 128, 256, 512, 1024]</dd>
</dl>
<p>P. Fränti, O. Virmajoki and V. Hautamäki,
“Fast agglomerative clustering using a k-nearest neighbor graph”,
IEEE Trans. on Pattern Analysis and Machine Intelligence, 28 (11),
1875-1881, November 2006.</p>
<dl class="method">
<dt id="cortex.built_ins.datasets.toysets.DIM_set.check_exists">
<code class="descname">check_exists</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#DIM_set.check_exists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.DIM_set.check_exists" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns:</p>
</dd></dl>

<dl class="method">
<dt id="cortex.built_ins.datasets.toysets.DIM_set.files">
<code class="descname">files</code><span class="sig-paren">(</span><em>dim</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#DIM_set.files"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.DIM_set.files" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>dim</strong> – </td>
</tr>
</tbody>
</table>
<p>Returns:</p>
</dd></dl>

<dl class="attribute">
<dt id="cortex.built_ins.datasets.toysets.DIM_set.sync_files">
<code class="descname">sync_files</code><em class="property"> = 5</em><a class="headerlink" href="#cortex.built_ins.datasets.toysets.DIM_set.sync_files" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="cortex.built_ins.datasets.toysets.DIM_set.urls">
<code class="descname">urls</code><em class="property"> = ['http://cs.joensuu.fi/sipu/datasets/dim032.txt', 'http://cs.joensuu.fi/sipu/datasets/dim032.pa', 'http://cs.joensuu.fi/sipu/datasets/dim064.txt', 'http://cs.joensuu.fi/sipu/datasets/dim064.pa', 'http://cs.joensuu.fi/sipu/datasets/dim128.txt', 'http://cs.joensuu.fi/sipu/datasets/dim128.pa', 'http://cs.joensuu.fi/sipu/datasets/dim256.txt', 'http://cs.joensuu.fi/sipu/datasets/dim256.pa', 'http://cs.joensuu.fi/sipu/datasets/dim512.txt', 'http://cs.joensuu.fi/sipu/datasets/dim512.pa', 'http://cs.joensuu.fi/sipu/datasets/dim1024.txt', 'http://cs.joensuu.fi/sipu/datasets/dim1024.pa']</em><a class="headerlink" href="#cortex.built_ins.datasets.toysets.DIM_set.urls" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="cortex.built_ins.datasets.toysets.Flame">
<em class="property">class </em><code class="descclassname">cortex.built_ins.datasets.toysets.</code><code class="descname">Flame</code><span class="sig-paren">(</span><em>root</em>, <em>*select</em>, <em>stardardize=False</em>, <em>load=False</em>, <em>download=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#Flame"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.Flame" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cortex.built_ins.datasets.toysets._Shapes</span></code></p>
<p>Download and use the Flame dataset.</p>
<p>N=240, k=2, D=2</p>
<p>L. Fu and E. Medico,
FLAME, a novel fuzzy clustering method for the analysis of DNA microarray
data. BMC bioinformatics, 2007.</p>
<dl class="attribute">
<dt id="cortex.built_ins.datasets.toysets.Flame.urls">
<code class="descname">urls</code><em class="property"> = ['http://cs.joensuu.fi/sipu/datasets/flame.txt']</em><a class="headerlink" href="#cortex.built_ins.datasets.toysets.Flame.urls" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="cortex.built_ins.datasets.toysets.G2">
<em class="property">class </em><code class="descclassname">cortex.built_ins.datasets.toysets.</code><code class="descname">G2</code><span class="sig-paren">(</span><em>root</em>, <em>*select</em>, <em>stardardize=False</em>, <em>load=False</em>, <em>download=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#G2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.G2" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cortex.built_ins.datasets.toysets._SmallDataset</span></code></p>
<p>Download and use G2 dataset.</p>
<dl class="docutils">
<dt>dim <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
<dd>Dimension of the input space</dd>
<dt>sd <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
<dd>Standard deviation of the Gaussian used to generate the 2 modes</dd>
</dl>
<p>See possible values below.</p>
<p>The datasets include two Gaussian normal distributions:</p>
<p>Dataset name:    G2-dim-sd
Centroid 1:      [500,500, …]
Centroid 2:      [600,600, …]
Dimensions:      dim = 1,2,4,8,16, … 1024
St.Dev:          sd  = 10,20,30,40 … 100</p>
<p>They have been created using the following C-language code:</p>
<p>Calculate random value in (0,1]:</p>
<p>U = (double)(rand()+1)/(double)(RAND_MAX+1);
V = (double)(rand()+1)/(double)(RAND_MAX+1);</p>
<p>Box-Muller method to create two independent standard
one-dimensional Gaussian samples:</p>
<p>X = sqrt(-2*log(U))*cos(2*3.14159*V);  /* pi = 3.14159 <a href="#id1"><span class="problematic" id="id2">*</span></a>/
Y = sqrt(-2*log(U))*sin(2*3.14159*V);</p>
<p>Adjust mean and deviation:</p>
<p>X_final = 500 + s * X;    /* mean + deviation * X <a href="#id3"><span class="problematic" id="id4">*</span></a>/
Y_final = 600 + s * Y;</p>
<p>The points are stored in the files so that:
- First 1024 points are from the cluster 1
- Rest  1024 points are from the cluster 2</p>
<p>P. Fränti R. Mariescu-Istodor and C. Zhong, “XNN graph”
IAPR Joint Int. Workshop on Structural, Syntactic, and Statistical Pattern
Recognition Merida, Mexico, LNCS 10029, 207-217, November 2016.</p>
<dl class="method">
<dt id="cortex.built_ins.datasets.toysets.G2.check_exists">
<code class="descname">check_exists</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#G2.check_exists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.G2.check_exists" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns:</p>
</dd></dl>

<dl class="method">
<dt id="cortex.built_ins.datasets.toysets.G2.prepare">
<code class="descname">prepare</code><span class="sig-paren">(</span><em>dim</em>, <em>sd</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#G2.prepare"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.G2.prepare" title="Permalink to this definition">¶</a></dt>
<dd><p>Make torch Tensors from g2-<cite>dim</cite>-<cite>sd</cite> and infer labels.
:param dim:
:param sd:</p>
<p>Returns:</p>
</dd></dl>

<dl class="attribute">
<dt id="cortex.built_ins.datasets.toysets.G2.urls">
<code class="descname">urls</code><em class="property"> = ['http://cs.joensuu.fi/sipu/datasets/g2-txt.zip']</em><a class="headerlink" href="#cortex.built_ins.datasets.toysets.G2.urls" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="cortex.built_ins.datasets.toysets.Jain">
<em class="property">class </em><code class="descclassname">cortex.built_ins.datasets.toysets.</code><code class="descname">Jain</code><span class="sig-paren">(</span><em>root</em>, <em>*select</em>, <em>stardardize=False</em>, <em>load=False</em>, <em>download=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#Jain"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.Jain" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cortex.built_ins.datasets.toysets._Shapes</span></code></p>
<p>Download and use the ORIGINAL (2 moons) Jain dataset.</p>
<p>N=373, k=2, D=2</p>
<p>A. Jain and M. Law,
Data clustering: A user’s dilemma.
Lecture Notes in Computer Science, 2005.</p>
<dl class="attribute">
<dt id="cortex.built_ins.datasets.toysets.Jain.urls">
<code class="descname">urls</code><em class="property"> = ['http://cs.joensuu.fi/sipu/datasets/jain.txt']</em><a class="headerlink" href="#cortex.built_ins.datasets.toysets.Jain.urls" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="cortex.built_ins.datasets.toysets.Pathbased">
<em class="property">class </em><code class="descclassname">cortex.built_ins.datasets.toysets.</code><code class="descname">Pathbased</code><span class="sig-paren">(</span><em>root</em>, <em>*select</em>, <em>stardardize=False</em>, <em>load=False</em>, <em>download=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#Pathbased"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.Pathbased" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cortex.built_ins.datasets.toysets._Shapes</span></code></p>
<p>Download and use the Pathbased dataset.</p>
<p>N=300, k=3, D=2</p>
<p>H. Chang and D.Y. Yeung,
Robust path-based spectral clustering.
Pattern Recognition, 2008.</p>
<dl class="attribute">
<dt id="cortex.built_ins.datasets.toysets.Pathbased.urls">
<code class="descname">urls</code><em class="property"> = ['http://cs.joensuu.fi/sipu/datasets/pathbased.txt']</em><a class="headerlink" href="#cortex.built_ins.datasets.toysets.Pathbased.urls" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="cortex.built_ins.datasets.toysets.R15">
<em class="property">class </em><code class="descclassname">cortex.built_ins.datasets.toysets.</code><code class="descname">R15</code><span class="sig-paren">(</span><em>root</em>, <em>*select</em>, <em>stardardize=False</em>, <em>load=False</em>, <em>download=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#R15"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.R15" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cortex.built_ins.datasets.toysets._Shapes</span></code></p>
<p>Download and use the R15 dataset.</p>
<p>N=600, k=15, D=2</p>
<p>C.J. Veenman, M.J.T. Reinders, and E. Backer,
A maximum variance cluster algorithm.
IEEE Trans. Pattern Analysis and Machine Intelligence 2002.</p>
<dl class="attribute">
<dt id="cortex.built_ins.datasets.toysets.R15.urls">
<code class="descname">urls</code><em class="property"> = ['http://cs.joensuu.fi/sipu/datasets/R15.txt']</em><a class="headerlink" href="#cortex.built_ins.datasets.toysets.R15.urls" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="cortex.built_ins.datasets.toysets.S_set">
<em class="property">class </em><code class="descclassname">cortex.built_ins.datasets.toysets.</code><code class="descname">S_set</code><span class="sig-paren">(</span><em>root</em>, <em>*select</em>, <em>stardardize=False</em>, <em>load=False</em>, <em>download=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#S_set"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.S_set" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cortex.built_ins.datasets.toysets._SmallDataset</span></code></p>
<p>Download and use S-sets dataset.</p>
<p>Synthetic 2-d data with N=5000 vectors and k=15 Gaussian clusters
with different degree of cluster overlapping.</p>
<dl class="docutils">
<dt>num <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
<dd>Higher <cite>num</cite> means, higher chance of overlapping between the modes.
Choose: [1, 2, 3, 4]</dd>
</dl>
<p>P. Fränti and O. Virmajoki,
“Iterative shrinking method for clustering problems”,
Pattern Recognition, 39 (5), 761-765, May 2006.</p>
<dl class="method">
<dt id="cortex.built_ins.datasets.toysets.S_set.check_exists">
<code class="descname">check_exists</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#S_set.check_exists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.S_set.check_exists" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns:</p>
</dd></dl>

<dl class="method">
<dt id="cortex.built_ins.datasets.toysets.S_set.files">
<code class="descname">files</code><span class="sig-paren">(</span><em>num</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#S_set.files"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.S_set.files" title="Permalink to this definition">¶</a></dt>
<dd><p>Make torch Tensors from ‘s{num}.txt’ and fetch labels.
:param num:</p>
<p>Returns:</p>
</dd></dl>

<dl class="attribute">
<dt id="cortex.built_ins.datasets.toysets.S_set.sync_files">
<code class="descname">sync_files</code><em class="property"> = 5</em><a class="headerlink" href="#cortex.built_ins.datasets.toysets.S_set.sync_files" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="cortex.built_ins.datasets.toysets.S_set.urls">
<code class="descname">urls</code><em class="property"> = ['http://cs.joensuu.fi/sipu/datasets/s1.txt', 'http://cs.joensuu.fi/sipu/datasets/s2.txt', 'http://cs.joensuu.fi/sipu/datasets/s3.txt', 'http://cs.joensuu.fi/sipu/datasets/s4.txt', 'http://cs.joensuu.fi/sipu/datasets/s-originals.zip']</em><a class="headerlink" href="#cortex.built_ins.datasets.toysets.S_set.urls" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="cortex.built_ins.datasets.toysets.Spiral">
<em class="property">class </em><code class="descclassname">cortex.built_ins.datasets.toysets.</code><code class="descname">Spiral</code><span class="sig-paren">(</span><em>root</em>, <em>*select</em>, <em>stardardize=False</em>, <em>load=False</em>, <em>download=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#Spiral"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.Spiral" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cortex.built_ins.datasets.toysets._Shapes</span></code></p>
<p>Download and use the Spiral dataset.</p>
<p>N=312, k=3, D=2</p>
<p>H. Chang and D.Y. Yeung,
Robust path-based spectral clustering.
Pattern Recognition, 2008.</p>
<dl class="attribute">
<dt id="cortex.built_ins.datasets.toysets.Spiral.urls">
<code class="descname">urls</code><em class="property"> = ['http://cs.joensuu.fi/sipu/datasets/spiral.txt']</em><a class="headerlink" href="#cortex.built_ins.datasets.toysets.Spiral.urls" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="cortex.built_ins.datasets.toysets.Unbalance">
<em class="property">class </em><code class="descclassname">cortex.built_ins.datasets.toysets.</code><code class="descname">Unbalance</code><span class="sig-paren">(</span><em>root</em>, <em>*select</em>, <em>stardardize=False</em>, <em>load=False</em>, <em>download=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#Unbalance"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.Unbalance" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cortex.built_ins.datasets.toysets._SmallDataset</span></code></p>
<p>Download and use the Unbalance dataset.</p>
<p>Synthetic 2-d data with N=6500 vectors and k=8 Gaussian clusters</p>
<p>There are 3 “dense” clusters of 2000 vectors each and
5 “sparse” clusters of 100 vectors each.</p>
<p>M. Rezaei and P. Fränti,
“Set-matching methods for external cluster validity”,
IEEE Trans. on Knowledge and Data Engineering, 28 (8), 2173-2186,
August 2016.</p>
<dl class="method">
<dt id="cortex.built_ins.datasets.toysets.Unbalance.check_exists">
<code class="descname">check_exists</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#Unbalance.check_exists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.Unbalance.check_exists" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns:</p>
</dd></dl>

<dl class="method">
<dt id="cortex.built_ins.datasets.toysets.Unbalance.files">
<code class="descname">files</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#Unbalance.files"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.Unbalance.files" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns:</p>
</dd></dl>

<dl class="attribute">
<dt id="cortex.built_ins.datasets.toysets.Unbalance.sync_files">
<code class="descname">sync_files</code><em class="property"> = 4</em><a class="headerlink" href="#cortex.built_ins.datasets.toysets.Unbalance.sync_files" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="cortex.built_ins.datasets.toysets.Unbalance.urls">
<code class="descname">urls</code><em class="property"> = ['http://cs.joensuu.fi/sipu/datasets/unbalance.txt', 'http://cs.joensuu.fi/sipu/datasets/unbalance-gt-pa.zip']</em><a class="headerlink" href="#cortex.built_ins.datasets.toysets.Unbalance.urls" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="function">
<dt id="cortex.built_ins.datasets.toysets.make_tds_random_and_split">
<code class="descclassname">cortex.built_ins.datasets.toysets.</code><code class="descname">make_tds_random_and_split</code><span class="sig-paren">(</span><em>C</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/toysets.html#make_tds_random_and_split"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.toysets.make_tds_random_and_split" title="Permalink to this definition">¶</a></dt>
<dd><p>Wraps Toyset class to add random splitting.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>C</strong> – Toyset data class to be wrapped</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">RandomSplitting class that wraps Toyset data class</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>
</div>
<div class="section" id="module-cortex.built_ins.datasets.utils">
<span id="cortex-built-ins-datasets-utils-module"></span><h2>cortex.built_ins.datasets.utils module<a class="headerlink" href="#module-cortex.built_ins.datasets.utils" title="Permalink to this headline">¶</a></h2>
<p>Extra functions for build-in datasets</p>
<dl class="function">
<dt id="cortex.built_ins.datasets.utils.build_transforms">
<code class="descclassname">cortex.built_ins.datasets.utils.</code><code class="descname">build_transforms</code><span class="sig-paren">(</span><em>normalize=True</em>, <em>center_crop=None</em>, <em>image_size=None</em>, <em>random_crop=None</em>, <em>flip=None</em>, <em>random_resize_crop=None</em>, <em>random_sized_crop=None</em>, <em>use_sobel=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cortex/built_ins/datasets/utils.html#build_transforms"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cortex.built_ins.datasets.utils.build_transforms" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>normalize</strong> – </li>
<li><strong>center_crop</strong> – </li>
<li><strong>image_size</strong> – </li>
<li><strong>random_crop</strong> – </li>
<li><strong>flip</strong> – </li>
<li><strong>random_resize_crop</strong> – </li>
<li><strong>random_sized_crop</strong> – </li>
<li><strong>use_sobel</strong> – </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Returns:</p>
</dd></dl>

</div>
<div class="section" id="module-cortex.built_ins.datasets">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-cortex.built_ins.datasets" title="Permalink to this headline">¶</a></h2>
</div>
</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="cortex.built_ins.models.html" class="btn btn-neutral float-right" title="cortex.built_ins.models package" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="cortex.built_ins.html" class="btn btn-neutral" title="cortex.built_ins package" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2018, MILA.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'./',
            VERSION:'',
            LANGUAGE:'None',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  true,
            SOURCELINK_SUFFIX: '.txt'
        };
    </script>
      <script type="text/javascript" src="_static/jquery.js"></script>
      <script type="text/javascript" src="_static/underscore.js"></script>
      <script type="text/javascript" src="_static/doctools.js"></script>
      <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

  

  <script type="text/javascript" src="_static/js/theme.js"></script>

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>